//
//  FYNetworkingRequestStting.h
//  FYNetworking
//
//  Created by Felix Yin on 2017/5/5.
//  Copyright © 2017年 Felix Yin. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef enum : NSUInteger {
    FYRequestTypeGet,
    FYRequestTypePost,
    FYRequestTypeUpload,
    FYRequestTypeDownload,
} FYREquestType;

typedef void (^FYRequestCallBack)(id data);
typedef void (^FYRequestProgressCallBack)(NSProgress *taskProgress);
typedef void (^FYRequestCompleteCallBack)(id data,NSError *requestError);
typedef void (^FYRequestOperationCallBack)();

@interface FYNetworkingRequestStting : NSObject

/**
 *  请求地址
 */
@property (nonatomic, copy) NSString *requestPath;
/**
 *  请求参数
 */
@property (nonatomic, copy) NSDictionary *parameter;
/**
 *  请求类型
 */
@property (nonatomic, assign) FYREquestType requestType;
/**
 *  请求回调
 */
@property (nonatomic, copy) FYRequestCallBack requestCallBack;
/**
 *  请求进度回调
 */
@property (nonatomic, copy) FYRequestProgressCallBack requestProgressCallBack;
/**
 *  上传进度回调
 */
@property (nonatomic, copy) FYRequestProgressCallBack uploadProgressCallBack;
/**
 *  下载进度回调
 */
@property (nonatomic, copy) FYRequestProgressCallBack downLoadProgressCallBack;
/**
 *  操作回调
 */
@property (nonatomic, copy) FYRequestOperationCallBack requestOperationCallBack;
/**
 *  请求完成回调
 */
@property (nonatomic, copy) FYRequestCompleteCallBack requestCompleteCallBack;

/**
 *  初始化请求配置
 *
 *  @param path              请求路径
 *  @param parameter         请求参数
 *  @param type              请求类型
 *  @param progressCallBack  请求进度回调
 *  @param operationCallBack 请求操作回调
 *  @param complete          请求完成回调
 *
 *  @return 返回请求配置
 */
- (instancetype) initWithRequestPath:(NSString *) path requestParameter:(NSDictionary *) parameter requestType:(FYREquestType) type  requestProgressCallBack:(FYRequestProgressCallBack) progressCallBack requestOperationCallBack:(FYRequestOperationCallBack) operationCallBack requestCompleteCallBack:(FYRequestCompleteCallBack) complete;

@end


@interface FYNetworkingFileRequestStting:FYNetworkingRequestStting

/**
 *  上传文件名
 */
@property (nonatomic, copy) NSString *fileName;
/**
 *  上传数据名
 */
@property (nonatomic, copy) NSString *dataName;
/**
 *  文件存放路径
 */
@property (nonatomic, copy) NSString *filePath;
/**
 *  文件传输类型
 */
@property (nonatomic, copy) NSString *mineType;

/**
 *  初始化上传文件请求配置
 *
 *  @param path              请求地址
 *  @param parameter         请求参数
 *  @param type              请求类型
 *  @param fileName          请求文件名
 *  @param dataName          请求数据名
 *  @param filePath          上传文件存放路径
 *  @param mineType          上传文件类型
 *  @param uploadProgressCallBack  上传文件进度
 *  @param downloadProgress  下载文件进度
 *  @param operationCallBack 操作回调
 *  @param complete          上传文件回调
 *
 *  @return 返回上传文件配置
 */
- (instancetype) initWithFileRequestPath:(NSString *) path requestParameter:(NSDictionary *) parameter requestType:(FYREquestType) type fileName:(NSString *)fileName dataName:(NSString *)dataName filePath:(NSString *) filePath mineType:(NSString *)mineType  uploadProgressCallBack:(FYRequestProgressCallBack) uploadProgressCallBack downloadProgress:(FYRequestProgressCallBack) downloadProgress requestOperationCallBack:(FYRequestOperationCallBack) operationCallBack requestCompleteCallBack:(FYRequestCompleteCallBack) complete;

@end
